home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr52 / 5333de.zip / 1.PRG next >
Text File  |  1993-04-03  |  826b  |  40 lines

  1. // Update the client files CA of the Pears
  2. clear
  3. private I
  4.  
  5. Select A
  6. Use CA
  7. zap
  8. FOR I = 1 TO 3000
  9.    append blank
  10.    Replace CAID     with NEW_ID("CA")
  11.    ? "REC#"+str(recno(),4)+"   "
  12.    ? "string= "+str(memory(0),4)+"K  "+;
  13.                 "free  = "+str(memory(1),4)+"K  "+;
  14.                 "run   = "+str(memory(2),4)+"K  "+;
  15.                 "???   = "+str(memory(3),4)+"K  "
  16. next
  17.  
  18. Function NEW_ID(P1)
  19. ***************************************
  20. *
  21. ***************************************
  22. private   R,;   && returns the latest ID
  23.           W,;  && saves the previous workarea chosen
  24.           D
  25.  
  26. W = select()
  27. use IDS NEW
  28. locate for DS == PadR(P1, 8)
  29. if found()
  30.       D = val(NEWID)+1
  31.       R := PadL( D, len(trim(NEWID)), "0")
  32.       replace NEWID with R
  33. endif
  34.  
  35. use
  36. select (W)
  37. return R
  38.  
  39.  
  40.